package com.sky.controller.admin;


import com.sky.dto.OrdersPaymentDTO;
import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrdersService;
import com.sky.vo.OrderPaymentVO;
import com.sky.vo.OrderSubmitVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 订单表 前端控制器
 * </p>
 *
 * @author lwd
 * @since 2023-04-24
 */
@RestController
@RequestMapping("/user/order")
@Slf4j
public class OrdersAdminController {
    @Autowired
    private OrdersService ordersService;

    /**
     * 取消订单
     * @param id
     * @return
     */
    @PutMapping("cancel")
    @ApiOperation("取消订单")
    public Result OrderType(@PathVariable Long id) {
        this.ordersService.orderStop(id);
        return Result.success();
    }

    /**
     * 订单派送
     * @param id
     * @return
     */
    @PutMapping("cancel/{id}")
    @ApiOperation("订单派送")
    public Result cancelOrder(@PathVariable Long id) {
        this.ordersService.orderDelivery(id);
        return Result.success();
    }

    /**
     * 完成订单
     * @param id
     * @return
     */
    @PutMapping("complete/{id}")
    @ApiOperation("完成订单")
    public Result completeOrder(@PathVariable Long id) {
        this.ordersService.completeOrder(id);
        return Result.success();
    }


}
